package com.usefullc.system.controller;

import com.usefullc.system.entity.WebResult;
import com.usefullc.system.service.MessagePublishService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author: Sampson
 * @date: 2022-01-10 15:28
 */
@RestController
@RequestMapping(path = "/system/tools/")
@Api( tags="手工操作管理 ")
public class ToolsController extends BaseController {

    @Autowired
    private MessagePublishService messagePublishService;


    @ApiOperation(value = "发布事件消息",  response = WebResult.class)
    @PostMapping(path = "publishMessage", produces = "application/json")
    public WebResult publishMessage(HttpServletRequest request, @RequestParam String key) {
        messagePublishService.publish(key);
        return WebResultBuilder.successResult();
    }





}
